"""
聚宽常用函数
使用本文件用于本地代码编写和单元测试

"""

global g

#
def set_benchmark():
    pass

def set_option():
    pass


class log():

    def __init__(self):
        pass

    def set_level():
        pass

    def info():
        pass

def set_subportfolios():
    pass

def SubPortfolioConfig():
    pass

def set_order_cost():
    pass

def set_slippage():
    pass

def StepRelatedSlippage():
    pass

def run_daily():
    pass

def OrderCost():
    pass


def get_future_contracts():
    pass

def get_trades():
    pass

def get_dominant_future():
    pass

def set_commission():
    pass

def PerTrade():
    pass

def FixedSlippage():
    pass

def attribute_history():
    pass

def get_current_data():
    pass

def order_target():
    pass

def order():
    pass

def get_index_stocks():
    pass

def get_fundamentals():
    pass

def order_target_value():
    pass

def query():
    pass

valuation = {}
indicator = {}

class OrderStatus():
    # 订单新创建未委托，用于盘前/隔夜单，订单在开盘时变为 open 状态开始撮合
    new = 8

    # 订单未完成, 无任何成交
    open = 0

    # 订单未完成, 部分成交
    filled = 1

    # 订单完成, 已撤销, 可能有成交, 需要看 Order.filled 字段
    canceled = 2

    # 订单完成, 交易所已拒绝, 可能有成交, 需要看 Order.filled 字段
    rejected = 3

    # 订单完成, 全部成交, Order.filled 等于 Order.amount
    held = 4

    # 订单取消中，只有实盘会出现，回测/模拟不会出现这个状态
    pending_cancel = 9 

def get_orders():
    pass

def get_open_orders():
    pass

balance = {}

def get_industry_stocks():
    pass

income = {}

def get_security_info():
    pass

def get_price():
    pass

def read_file():
    pass

def get_all_securities():
    pass

def get_future_code():
    pass